home *** CD-ROM | disk | FTP | other *** search
- // GETINFO SCRIPTING
- // http://dvdworld.com.br/
- // Script modificado por O Guardiπo versπo 1.0
- // 02-01-2005
-
-
- (***************************************************
- * For use with Ant Movie Catalog 3.4.0 *
- * www.antp.be/software/moviecatalog *
- * *
- * The source code of the script can be used in *
- * another program only if full credits to *
- * script author and a link to Ant Movie Catalog *
- * website are given in the About box or in *
- * the documentation of the program *
- * *
- * Please dont remove credits *
- * Reportem os erros para bruno_mga@hotmail.com *
- ***************************************************)
- program dvdworld;
- const
- BaseAddress = 'http://dvdworld.com.br/dvdworld.hts';
- ManualPictureSelect = True;
- ExternalPictures = False;
- DescriptionToImport = 2;
- var
- MovieName: string;
- MovieURL: string;
- function HTMLRemove(Value: String): String;
- begin
- HTMLDecode(Value);
- HTMLRemoveTags(Value);
- Value := Trim(Value);
- result := Value;
- end;
-
- function UpFirstLetterWord(texto:string):string; //Function Made By O Guardiπo
- var espaco:integer;
- sst:string;
- begin
- texto:=AnsiUpFirstLetter(AnsiLowerCase(texto));
- repeat
- espaco:=Pos(' ',texto);
- sst:=AnsiUpperCase(Copy(texto,espaco+1,1));
- texto:=Copy(texto,1,espaco-1)+'/|\'+sst+Copy(texto,espaco+2,length(texto));
- until Pos(' ',texto)=0;
- texto := StringReplace(texto, '/|\', ' ');
- if Copy(texto,1,1)=' ' then
- texto:=Copy(texto,2,length(texto));
- result:=texto;
- end;
-
- procedure AnalyzeFilmPage(Address: String);
- var
- Page : TStringList;
- Line, Value : string;
- LineNr, BeginPos, EndPos: Integer;
- AllTitles: TStringList;
- url_imdb:string;
- nome_orig:string;
- nome_trad:string;
- pais:string;
- genero:string;
- realizac:string;
- Interpretes:string;
- descricao:string;
- capa:string;
- begin
- Page := TStringList.Create;
- value := 'http://216.247.85.101/images/'+Address+'.jpg';
- // (it is working well)
- GetPicture(Value, False);
- Address:='http://dvdworld.com.br/dvdworld.hts?+'+Address+'+acha';
- Page.Text := GetPage(Address);
- SetField(fieldURL, Address);
-
- LineNr := FindLine('Tφtulo Original:', Page, 0);
- if LineNr<>-1 then
- begin
- Value := Page.GetString(LineNr);
- BeginPos := pos('/b>',value);
- EndPos := pos(' - ',value)-3;
- nome_orig:=copy(value,BeginPos+3,EndPos-BeginPos);
- nome_orig:=HTMLRemove(nome_orig);
- SetField(fieldOriginalTitle, nome_orig);
- end;
-
- LineNr := FindLine('<td align="left" valign="top"><font face="Arial, Helvetica, sans-serif" size="4" color="#000066"><b>', Page, 0);
- if LineNr<>-1 then
- begin
- Value := Page.GetString(LineNr);
- nome_trad:=HTMLRemove(Value);
- nome_trad:=UpFirstLetterWord(nome_trad);
- SetField(fieldTranslatedTitle, nome_trad);
- end;
-
- LineNr := FindLine('<b>Diretor:</b>', Page, 0);
- if LineNr<>-1 then
- begin
- Value := Page.GetString(LineNr);
- BeginPos := pos('/b>',value);
- EndPos := pos('</f',value);
- realizac:=copy(value,BeginPos+3,EndPos);
- realizac:=HTMLRemove(realizac);
- SetField(fieldDirector, realizac);
- end;
-
- LineNr := FindLine('Atores: </b>', Page, 0);
- if LineNr<>-1 then
- begin
- Value := Page.GetString(LineNr);
- BeginPos := pos('/b>',value);
- EndPos := pos('</f',value);
- Interpretes:=copy(value,BeginPos+3,EndPos);
- Interpretes:=HTMLRemove(Interpretes);
- SetField(fieldActors, Interpretes);
- end;
-
- LineNr := FindLine('GÊNERO', Page, 0)+4;
- if LineNr<>4 then
- begin
- value:=HTMLRemove(Page.GetString(LineNr));
- SetField(fieldCategory, value);
- end;
-
- LineNr := FindLine('DE PRODUÇÃ', Page, 0)+4;
- if LineNr<>4 then
- begin
- value:=HTMLRemove(Page.GetString(LineNr));
- SetField(fieldYear, value);
- end;
-
- LineNr := FindLine('DURAÇÃ', Page, 0)+5;
- if LineNr<>5 then
- begin
- value:=HTMLRemove(Page.GetString(LineNr));
- SetField(fieldLength, value);
- end;
-
- LineNr := FindLine('<b>ESTUDIO</b>', Page, 0)+4;
- if LineNr<>4 then
- begin
- value:=HTMLRemove(Page.GetString(LineNr));
- SetField(fieldProducer, value);
- end;
-
- LineNr := FindLine('<b>Sinopse:</b>', Page, 0);
- if LineNr<>-1 then
- begin
- Value := Page.GetString(LineNr);
- BeginPos := pos('/b>',value);
- EndPos := pos('</f',value);
- descricao:=copy(value,BeginPos+3,EndPos);
- descricao:=HTMLRemove(descricao);
- SetField(fieldDescription, descricao);
- end;
-
- end;
-
-
-
- function FindLine(Pattern: string; List: TStringList; StartAt: Integer): Integer;
- var
- i: Integer;
- begin
- result := -1;
- if StartAt < 0 then
- StartAt := 0;
- for i := StartAt to List.Count-1 do
- if Pos(Pattern, List.GetString(i)) <> 0 then
- begin
- result := i;
- Break;
- end;
- end;
-
- procedure AnalyzePage(Address: string);
- var
- Page: TStringList;
- LineNr, StartPos, EndPos: Integer;
- Line: string;
- x:integer;
- MovieAddress, findMovieName,linedown : string;
- guardar,url, nome_filme:string;
- begin
- PickTreeClear;
- Page := TStringList.Create;
- Page.Text := GetPage(Address);
-
- if (pos('tφtulos que contΘm a palavra chave', Page.Text)>0) and (pos('Nada achado!.', Page.Text) = 0) then
- begin
- LineNr :=0;
- repeat
- LineNr := FindLine('+acha', Page, LineNr);
- If LineNr >0 Then Begin
- Line := Page.GetString(LineNr);
- StartPos := pos('hts?+', Line)+1;
- url:=(copy(line,StartPos+4,7));
- EndPos := pos('</A>',Line)-1;
- Line := copy(Line, StartPos+18, EndPos);
- Line:= HTMLRemove(Line);
- nome_filme:=Line;
- PickTreeAdd(nome_filme, url);
- LineNr := LineNr + 1;
- End;
- until (LineNr<1);
- if PickTreeExec(Address) then begin
- AnalyzeFilmPage(Address);
- end;
- Page.Free;
- DisplayResults;
- end
- else
- ShowMessage('Nada achado!')
- end;
-
- begin
- PickListClear;
- MovieName := GetField(fieldOriginalTitle);
- if Input('Importar do DVDWorld', 'Escreva o nome do filme:', MovieName) then begin
- MovieName := StringReplace(MovieName, ' ', '%20');
- AnalyzePage('http://dvdworld.com.br/dvdworld.hts?+search+'+MovieName+'+titulo');
- end;
- end.
-